package com.why.zing.payapi.controller;

import com.alibaba.fastjson.JSON;
import com.why.zing.payapi.constant.Constants;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@Slf4j
@Api(tags = "健康检查接口")
@RestController
public class HealthController {

    @ApiOperation("健康监测接口")
    @GetMapping(value = "/healthCheck")
    public Boolean healthCheck(){
        log.info("-----------------迁移docker测试服务健康接口-------------------");
        return true;
    }

    @PostMapping(value = "/testCallBack")
    public String testCallBack(@RequestBody Map<String,Object> map){
        log.info("/testCallBack result is {}", JSON.toJSONString(map));
        return Constants.ALI_CALLBACK_SUCCESS;
    }
}
